<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<script>

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">|before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">b|efore    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  '17-0 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">b|efore    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">be|fore    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  '17-1 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">be|fore    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">bef|ore    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  '17-2 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">bef|ore    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">befo|re    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  '17-3 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">befo|re    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">befor|e    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  '17-4 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">befor|e    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before|    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  '17-5 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">before|    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before |   \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  '17-6 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">before |   \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0|\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  '17-7 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">before  |  \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0|\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  '17-8 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">before   | \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0|\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  '17-9 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">before    |\u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0|\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  '17-10 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0|\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7|\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  '17-11 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7|\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8|\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  '17-12 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8|\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9| \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  '17-13 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9| \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 |\u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  '17-14 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 |\u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0|\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  '17-15 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0|\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0|\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  '17-16 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0|\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6|\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  '17-17 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6|\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9|\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  '17-18 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9|\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7|\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  '17-19 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7|\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC|\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  '17-20 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC|\u05D5\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5|\u05E4\u05D3\u05D9\u05D4</div>',
  '17-21 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5|\u05E4\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4|\u05D3\u05D9\u05D4</div>',
  '17-22 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4|\u05D3\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3|\u05D9\u05D4</div>',
  '17-23 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3|\u05D9\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9|\u05D4</div>',
  '17-24 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9|\u05D4</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4|</div>',
  '17-25 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4|</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 120px;">before    \u05D0\u05D7\u05E8\u05D9 \u05D0\u05E0\u05E6\u05D9\u05E7\u05DC\u05D5\u05E4\u05D3\u05D9\u05D4|</div>',
  '17-26 rtl left character');
</script>
